package com.joshua.userservice;

import java.io.IOException;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;

import com.joshua.userservice.models.Continent;

@ContextConfiguration(locations = { "/applicationContext.xml" })
@Transactional
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = false)
public class App 
{
    public static void main( String[] args ) throws IOException
    {
    	/*Session session = HibernateUtil.currentSession();
		Transaction tx = session.beginTransaction();
		Continent continent = new Continent();
		continent.setFullName("Continent Asia");
		continent.setName("Asia");
		continent.setArea(87);
		continent.setCode("AS");
		session.save(continent);
		tx.commit();
		HibernateUtil.closeSession();*/
    	
    	ApplicationContext ctx = 
    			new ClassPathXmlApplicationContext("applicationContext.xml");
    	System.in.read();
    }
}
